home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_jade.idb / usr / freeware / include / sp / lib / Undo.h.z / Undo.h
Encoding:
C/C++ Source or Header  |  1999-07-21  |  1.6 KB  |  72 lines

  1. // Copyright (c) 1994 James Clark
  2. // See the file COPYING for copying permission.
  3.  
  4. #ifndef Undo_INCLUDED
  5. #define Undo_INCLUDED 1
  6. #ifdef __GNUG__
  7. #pragma interface
  8. #endif
  9.  
  10. #include "Link.h"
  11. #include "ContentToken.h"
  12. #include "OpenElement.h"
  13. #include "Allocator.h"
  14.  
  15. #ifdef SP_NAMESPACE
  16. namespace SP_NAMESPACE {
  17. #endif
  18.  
  19. class ParserState;
  20. class Event;
  21.  
  22. class Undo : public Link {
  23. public:
  24.   void *operator new(size_t sz, Allocator &alloc) { return alloc.alloc(sz); }
  25.   void *operator new(size_t sz) { return Allocator::allocSimple(sz); }
  26.   void operator delete(void *p) { Allocator::free(p); }
  27. #ifdef SP_HAVE_PLACEMENT_OPERATOR_DELETE
  28.   void operator delete(void *p, Allocator &) { Allocator::free(p); }
  29. #endif
  30.   Undo();
  31.   virtual ~Undo();
  32.   virtual void undo(ParserState *) = 0;
  33. private:
  34.   Undo(const Undo &);        // undefined
  35.   void operator=(const Undo &);    // undefined
  36. };
  37.  
  38. class UndoTransition : public Undo {
  39. public:
  40.   UndoTransition(const MatchState &);
  41.   void undo(ParserState *);
  42. private:
  43.   UndoTransition(const UndoTransition &); // undefined
  44.   void operator=(const UndoTransition &); // undefined
  45.   MatchState state_;
  46. };
  47.  
  48. class UndoStartTag : public Undo {
  49. public:
  50.   UndoStartTag();
  51.   void undo(ParserState *);
  52. private:
  53.   UndoStartTag(const UndoStartTag &); // undefined
  54.   void operator=(const UndoStartTag &);    // undefined
  55. };
  56.  
  57. class UndoEndTag : public Undo {
  58. public:
  59.   UndoEndTag(OpenElement *);
  60.   void undo(ParserState *);
  61. private:
  62.   UndoEndTag(const UndoEndTag &); // undefined
  63.   void operator=(const UndoEndTag &); // undefined
  64.   Owner<OpenElement> element_;
  65. };
  66.  
  67. #ifdef SP_NAMESPACE
  68. }
  69. #endif
  70.  
  71. #endif /* not Undo_INCLUDED */
  72.